package com.sunriz.refreshhcdata.refresh;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.Month;

/**
 * ClassName: Refresh
 * Package: com.sunriz.refreshhcdata.refresh
 * Description:
 *
 * @Author BuTang
 * @Create 2024/9/23 14:24
 * @Version 1.0
 */
@Component
public class Refresh {
    @Autowired
    com.sunriz.refreshhcdata.mapper.RefreshMapper refresh;

    @Scheduled( fixedRate = 1000L )
    public void setRefresh(){
        LocalDateTime now = LocalDateTime.now();
        int year = now.getYear();
        int month = now.getMonthValue();
        int day = now.getDayOfMonth();
        int hour = now.getHour();
        int minute = now.getMinute();
        int second = now.getSecond();

        refresh.setTime(year,month,day,hour,minute,second);
    }

}
